cmake_minimum_required(VERSION 3.1)
project(Vsort_test)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -pthread")

enable_testing()
include_directories(.)
set(TEST_COMMON_SRC
        v_sort_test_comm.cpp)

add_library(test_comm ${TEST_COMMON_SRC})
target_link_libraries(test_comm gtest)

function(TestGen BIN_NAME SRC_NAME OTHER_LINK)
    message("\nbin_name : ${BIN_NAME}")
    message("src_name : ${SRC_NAME}\n")
    add_executable(${BIN_NAME} ${SRC_NAME})
    target_link_libraries(${BIN_NAME} gtest_main v_sort test_comm ${OTHER_LINK})
endfunction()

TestGen(v_sort_test v_sort_test.cpp "")
TestGen(smallcase v_sort_test_smallcase.cpp "")
TestGen(v_sort_array_test v_sort_array_test.cpp "")

TestGen(serializer_test serializer_test.cpp filesort)